Skip to content

Align Bill-to Name 2 editability with the other bill-to address fields on sales documents#9096

Open
Franco111000 wants to merge 2 commits into
microsoft:mainfrom
Franco111000:fix-8312-bill-to-name-2-editability
Open

Align Bill-to Name 2 editability with the other bill-to address fields on sales documents#9096
Franco111000 wants to merge 2 commits into
microsoft:mainfrom
Franco111000:fix-8312-bill-to-name-2-editability

Conversation

@Franco111000

@Franco111000 Franco111000 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

What & why

On the Sales Order, Sales Quote, Blanket Sales Order, and Sales Invoice pages, "Bill-to Name 2" is only editable when the Bill-to option is "Another Customer". Every other field in the bill-to address group (Address, Address 2, City, County, Post Code, Country/Region Code, Contact No., Contact) is editable when "Custom Address" is selected or when the bill-to customer differs from the sell-to customer. As noted in the issue triage, the field was simply missed when that editability logic was applied to the group.

This change gives "Bill-to Name 2" the same Editable and Enabled expression as the rest of the group on those four pages. The country layers that carry copies of these pages (APAC, BE, CH, ES, FR, GB, IT, NA, NL, NO, RU) receive the identical two-property change, following the established practice of propagating W1 fixes to the localization layers.

Linked work

Fixes #8312

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

  • Extended the four existing bill-to editability tests (CustomAddressBillToOptionOnSalesQuotePage, ...SalesOrderPage, ...SalesInvoicePage, ...SalesBlanketOrderPage in UTPageActionsControls.Codeunit.al) so they now also assert that "Bill-to Name 2" is editable when "Custom Address" is selected, alongside the sibling address fields they already cover.
  • Verified that every page copy across the localization layers received the identical two-line change and nothing else (the diff is uniform, and byte order marks and line endings of the touched files are preserved).
  • Confirmed on the Sales Header table that "Bill-to Name 2" (field 6) is a plain text field with no OnValidate logic and no table relation, so widening its page editability has no side effects beyond allowing input.
  • I did not build the Base Application locally; the change is limited to two page control properties per page, replicating the exact expression already used by all sibling fields, and relies on the extended test coverage in CI.

Risk & compatibility

  • The Sales Credit Memo and Sales Return Order pages are intentionally not touched: they have no BillToOptions control, which the triage comment on the issue asks to track as a separate item.
  • The purchase documents have the same inconsistency on "Pay-to Name 2" (Purchase Quote, Purchase Order, Purchase Invoice). That is deliberately out of scope here and will be reported as its own issue.
  • No breaking changes: no object signatures, events, or table schema are affected.

…s on sales documents

The Bill-to Name 2 field on Sales Order, Sales Quote, Blanket Sales Order,
and Sales Invoice was only editable with the Another Customer bill-to
option. Every other field in the bill-to address group is editable when
Custom Address is selected or when the bill-to customer differs from the
sell-to customer. The field was missed when that editability logic was
applied to the group.

The same correction is propagated to the country layers that carry copies
of these pages (APAC, BE, CH, ES, FR, GB, IT, NA, NL, NO, RU), and the
existing bill-to editability tests now cover the field.
@Franco111000 Franco111000 requested a review from a team July 5, 2026 10:06
@github-actions github-actions Bot added the From Fork Pull request is coming from a fork label Jul 5, 2026
@github-actions github-actions Bot added the needs-approval Workflow runs require maintainer approval to start label Jul 5, 2026
@JesperSchulz JesperSchulz added the SCM GitHub request for SCM area label Jul 7, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 1

Recommendation: Accept with Suggestions

What this PR does

This PR makes Bill-to Name 2 use the same Editable and Enabled expressions as the other bill-to address fields on Sales Quote, Sales Order, Sales Invoice, and Blanket Sales Order pages. The change matches the sibling fields: the field is available for Custom Address and when the bill-to customer differs from the sell-to customer.

The fix addresses the reported root cause. I checked the target page copies and found the Bill-to Name 2 expressions are now consistent with Bill-to Address, Address 2, City, Post Code, Country/Region Code, Contact No., and Contact. Sales Credit Memo and Sales Return Order are not part of this change because they do not use the same BillToOptions control flow.

Suggestions

S1 - Test Enabled state for Name 2
The PR changes both Editable and Enabled, but the updated tests only assert Editable. Add Enabled() assertions for Bill-to Name 2 on the four sales pages so a future change cannot leave the control disabled for Custom Address.

Risk assessment and necessity

Risk: Low. The change is limited to page control properties and does not change table fields, validation logic, posting logic, events, or public APIs. The main regression surface is UI editability for bill-to address fields on sales documents.

Necessity: The change is necessary because GitHub issue #8312 gives a clear user scenario: Custom Address allows editing the other bill-to address fields but not Bill-to Name 2. No ADO work item was linked, so this assessment relies on the GitHub issue and the diff.


[AI-PR-REVIEW] version=1 system=github pr=9096 round=1 by=alexei-dobriansky sha=c3a1fa7a9fcbf9c287776255811c4c6e6e1d7e8f

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 1 · Outcome: completed

All six sub-skills ran; five completed with empty findings (no keyword/topic overlap with the diff), al-upgrade-review was not-applicable (no upgrade/install/schema/enum surface touched). Self-review found no cross-cutting defect clearing the agent-finding precision bar.

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

@github-actions github-actions Bot removed the needs-approval Workflow runs require maintainer approval to start label Jul 7, 2026
Review feedback: the change touches both Editable and Enabled, so the
four extended tests now assert both states for the field.
@Franco111000

Copy link
Copy Markdown
Contributor Author

Thanks for the review. S1 is addressed in 14decc6: the four extended tests now assert both Editable and Enabled for Bill-to Name 2.

On the failing checks, if I am not mistaken they look unrelated to this change: Unit Tests (NZ) failed downloading its artifact (ECONNRESET), and the Unit Tests (SE) failures are Sustainability approval workflow tests reporting a missing Sustainability Setup record, which this PR does not touch. A re-run would probably clear both.

@github-actions github-actions Bot added the needs-approval Workflow runs require maintainer approval to start label Jul 7, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 2

Recommendation: Accept

What this PR does

Since round 1, the PR only updates W1 test coverage. It adds Enabled() checks for Bill-to Name 2 to the Sales Quote, Sales Order, Sales Invoice, and Blanket Sales Order custom-address tests.

This addresses the open round-1 concern. The new assertions check the same control whose Enabled property was changed on the four pages, and no new application behavior was added in the round-2 diff.

Status of previous suggestions
ID Title Status Author response
S1 Test Enabled state for Name 2 Addressed Fixed in 14decc6; the four tests now assert both Editable and Enabled for Bill-to Name 2.
New observations (commits since round 1)

None - changes only addressed prior suggestions.

Risk assessment and necessity

Risk: Low. The round-2 diff touches only test code. The runtime change remains limited to page control properties and does not change table validation, posting logic, events, or public APIs.

Necessity: The GitHub bug describes a clear inconsistency: Custom Address unlocks sibling bill-to fields but not Bill-to Name 2. The new commit is necessary because the original test update covered Editable but not Enabled, even though both properties changed.


[AI-PR-REVIEW] version=1 system=github pr=9096 round=2 by=alexei-dobriansky sha=14decc6b19cdb2975ffa1baa2fd2c0a1309a5024 suggestions=S1:addressed parentRound=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

From Fork Pull request is coming from a fork needs-approval Workflow runs require maintainer approval to start SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Bill-to Name 2 is editable on other conditions than all other Bill-To Fields

4 participants